#ifndef XGE_GRAPHICS_ANIM_REC_H_
#define XGE_GRAPHICS_ANIM_REC_H_
#include "xge_common_config.h"
#include "anim.h"
#include "xdata_structure.h"

namespace xge{
namespace graphics{

  class BaseNode;

  class AnimatorReceiver {
  public:
    // Add a animator inside of this animator vector
    void AddAnimator   ( const AnimatorPtr& animator ) {
      animator_vector_.push_back(animator);
    }
    // Remove animator from the animator vector
    void RemoveAnimator( const AnimatorPtr& animator );
    // Calling this function will iterating all the animator
    // inside of this animator vector
    void VisitAnimator ( BaseNode* node , const Timer::tick_t& diff_time );
    // Ctor 
    AnimatorReceiver() {
      animator_vector_.reserve( RESERVE_SIZE );
    }
  protected:
    enum {
      RESERVE_SIZE = 4
    };
    typedef xge::vector< AnimatorPtr >::Vector AnimatorPtrVector;
    // Get the internal reference of this vector
    AnimatorPtrVector& animator_vector() {
      return animator_vector_;
    }
  private:
    // using this animator_vector to store the internal
    // animation pointer 
    AnimatorPtrVector animator_vector_;
  };


}
}

#endif// XGE_GRAPHICS_ANIM_REC_H_
